import fetch from 'common/src/utils/fetch';

/**
 * 查看学生列表信息
 * @param {*} params
 */
function getStudentList(params) {
    return fetch({
        url: '/api/scoremanagementservice/scoreChange/getStudentList',
        method: 'post',
        data: params
    });
}

function getStudentDetail(data = {}) {
    return fetch({
        url: `/api/scoremanagementservice/scoreChange/getStudentDetail?id=${data.id}&calendarId=${data.calendarId}&no=${data.no}&teachingClassId=${data.teachingClassId}&keepField=${data.keepField}`,
        method: 'get'
    });
}

function getScopeTypeList(data) { // 成绩记录方式对应的值
    return fetch({
        url: '/api/scoremanagementservice/scoreSettingController/queryScoreRecord?coretypeCode=' + data + '&projectId=1',
        method: 'get'
    });
}

function submitMessage(data) { // 成绩变更提交
    return fetch({
        url: '/api/scoremanagementservice/scoreChange/scoreChangeApply',
        data,
        method: 'post'
    });
}

/**
 * 获取成绩变更审核列表
 * @param {*} params
 */
function getApplyStudentList(params) {
    return fetch({
        url: '/api/scoremanagementservice//scoreChange/getApplyStudentList',
        data: params,
        method: 'post'
    });
}

export default{
    getStudentList,
    getStudentDetail,
    getScopeTypeList,
    submitMessage,
    getApplyStudentList
};
